var webpack = require("webpack");
var path = require("path");
    module.exports = {
        entry: "./www/src/js/index.js",
    output: {
        path: path.resolve(__dirname, "dist"),
		publicPath: "/dist/",
        filename: "bundle.js",
//		path: __dirname,
//      filename: "bundle.js"
    },
    module: {
        loaders: [
		/*
		 * 使用babel-loader加载jsx资源。 
		 */
		{
            test: /\.jsx?$/,
            exclude: /node_modules/,
            loader: "babel-loader",
            query: {
                presets: [
					"es2015",
					"react",
				],
            }
        }, 
		/*
		 * 使用style-loader, css-loader, postcss-loader加载css资源。
		 */
		{
            test: /\.css$/,
            loaders: [
				"style-loader",
				"css-loader?modules",
			]
        }, 
		/*
		 * 使用url-loader加载图片资源。
		 */
		{
            test: /\.(png|jpg)$/,
            loader: "url-loader?limit=40000",
        }]
    }
    };